home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.tree;
-
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Graphics;
- import java.awt.LayoutManager;
-
- public class DefaultTreeCellEditor$EditorContainer extends Container {
- // $FF: synthetic field
- private final DefaultTreeCellEditor this$0;
-
- public DefaultTreeCellEditor$EditorContainer(DefaultTreeCellEditor var1) {
- this.this$0 = var1;
- ((Container)this).setLayout((LayoutManager)null);
- }
-
- public void EditorContainer() {
- ((Container)this).setLayout((LayoutManager)null);
- }
-
- public void doLayout() {
- if (this.this$0.editingComponent != null) {
- Dimension var1 = ((Component)this).getSize();
- this.this$0.editingComponent.getPreferredSize();
- this.this$0.editingComponent.setLocation(this.this$0.offset, 0);
- this.this$0.editingComponent.setBounds(this.this$0.offset, 0, var1.width - this.this$0.offset, var1.height);
- }
-
- }
-
- public Dimension getPreferredSize() {
- if (this.this$0.editingComponent != null) {
- Dimension var1 = this.this$0.editingComponent.getPreferredSize();
- var1.width += this.this$0.offset + 5;
- Dimension var2 = this.this$0.renderer != null ? this.this$0.renderer.getPreferredSize() : null;
- if (var2 != null) {
- var1.height = Math.max(var1.height, var2.height);
- }
-
- if (this.this$0.editingIcon != null) {
- var1.height = Math.max(var1.height, this.this$0.editingIcon.getIconHeight());
- }
-
- var1.width = Math.max(var1.width, 100);
- return var1;
- } else {
- return new Dimension(0, 0);
- }
- }
-
- public void paint(Graphics var1) {
- Dimension var2 = ((Component)this).getSize();
- if (this.this$0.editingIcon != null) {
- int var3 = Math.max(0, (((Component)this).getSize().height - this.this$0.editingIcon.getIconHeight()) / 2);
- this.this$0.editingIcon.paintIcon(this, var1, 0, var3);
- }
-
- Color var4 = this.this$0.getBorderSelectionColor();
- if (var4 != null) {
- var1.setColor(var4);
- var1.drawRect(0, 0, var2.width - 1, var2.height - 1);
- }
-
- super.paint(var1);
- }
- }
-